<?php

/**
 * @filename ShowAction.class.php 
 * @encoding UTF-8 
 * @author yuzhiyuan <307090870@qq.com>
 * @copyright copyright 2013 (c) Emagsoftware Technology Co., Ltd. All Rights reserved.
 * @license ……
 * @datetime 2013-6-23  0:41:33
 * @version 1.0
 * @Description
  */
class ShowAction extends Action {
    public function index(){
    	$id = I('id',intval,0);
    	$db = M('Post');
    	$this->post = $db->find($id);
    	$sql = "select a.content as content,a.add_time as add_time,b.nickname as nickname from " .C('DB_PREFIX'). "comment as a left join " .C('DB_PREFIX')."user as b on a.u_id = b.id and a.p_id = '".$id."' order by add_time desc";
    	$this->comments = M()->query($sql);
        $this->display();
    }
}